inputA=input()
# 1,2,3   ['2', '4', '5']
splitStr = inputA.split(',')
# print(splitStr)
# splitFloat = []
# for str in splitStr:
#     splitFloat.append(float(str))
# 1,2,3
# ['1', '2', '3']
# [1.0, 2.0, 3.0] 
# print(splitFloat)
# float浮点数 就是小数，，int整数
grades=[int(grade) for grade in splitStr]
# print(grades)
if len(grades)>=3:
   grades.sort()
   del grades[-1]
   del grades[0]
   average=sum(grades)/len(grades)
if grades[-1] % 1 == 0:
   print(int(grades[-1]))
else:
   print(grades[-1])
if grades[0] % 1 == 0:
   print(int(grades[0]))
else:
   print(grades[0])
print(f"{average:.2f}",end="")